home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / progutil / iostream.zoo / README < prev    next >
Text File  |  1991-09-11  |  4KB  |  95 lines

  1. This package is an in-progess implementation of the C++
  2. iostream library, as well as an implementation of C stdio.
  3.  
  4. The entire package is Copyright Per Bothner 1991, except
  5. where explicitly noted.  Note that some code is derived
  6. from the Chris Torek's stdio implementation for BSD 4.4,
  7. developed by the University of California, Berkeley.
  8. I have not put copyright notices in all of the files yet.
  9. The licensing terms are those of the GNU Library License.
  10. If those terms are unacceptable, contact me;
  11. we can probably work out an alternative.
  12.  
  13. The package is far from complete, but it allows useful work.
  14. See the TODO file for list of things missing.
  15.  
  16. FEATURES:
  17.  
  18. * Full implementation of ANSI C stdio. (Mostly done.)
  19. * Full implementation of the streambuf layer of AT&T's
  20. iostream library for C++. (Mostly done.)
  21. * Impementation of most of the iostream layer of AT&T's
  22. iostream library. I will track the ANSI standard, and
  23. implement more as the details get firmer.
  24. * Full compatibility between stdio and streambufs.
  25. All stdio routines are implemented by coering the
  26. (FILE*) argument to a (streambuf*), and then doing
  27. streambuf operations.  You can do the same: For example,
  28. if you have a streambuf* sb, you can do fprintf((FILE*)sb, ...).
  29. Also, (streambuf*)stdin == cin->rdbuf(), so you never need
  30. to synchonize streams and stdio.
  31. * Binary compatibility with the old _iob implementation of stdio.
  32. Thus you can link with libraries compiled for old C libraries.
  33. (There is also binary compatibility with the unreleased GNU libc.)
  34. * A parsebuf sub-class of streambuf that is tailored for parsing
  35. and scanning text:  It keeps track of line numbers, and provides
  36. full access to the current input line with arbitrary seeks and
  37. unget/putback within the current line.
  38. * A string buffer class using an Emacs-style buffer gap.
  39. It provides first-class sub-strings and buffer markers.
  40. There is also an editbuf sub-class of streambuf that allows
  41. any number of streams to read or write in a buffer or a sub-string.
  42.  
  43. INSTALLATION:
  44.  
  45. I have only tried to install the system on a  68020-based Sony
  46. running NewsOS-3, a BSD-4.3 derivate.  I have used a pre-release
  47. of GNU libc, so if you're using an older libc, you might be
  48. mising some routines.
  49.  
  50. Note that the default configuration redefines the stdio part of libc.
  51. This may cause problems with routines in libc that call stdio
  52. routines; they may get the wrong (libc) version.
  53. Ideally, iostream should be be integrated with some libc
  54. implementation, replacing the stdio portion of the library;
  55. that has not been done yet.  If you don't want the iostream stdio
  56. implementation at all, follow the instruction in the section below.
  57.  
  58. The file ioconfig.h is intended to contain configuration flags.
  59. You may also want to hack streambuf.C if you prefer an
  60. alternative way to forcing flushes (via the call to flush_all())
  61. on exit().  The current scheme uses a static destructor for the
  62. variable io_defs__ which is of the dummy class __io_defs.
  63. The disadvantage is that it requires that the main program be a C++ file,
  64. so this is not suitable if you want to use iostream as the
  65. default implementation of stdio.
  66.  
  67. INSTALLING WITHOUT THE STDIO IMPLEMENTATION:
  68.  
  69. By default, the library includes a almost-complete implementation
  70. of the stdio library for ANSI standard C.  It includes an
  71. emulation trick so that you can use this implementation
  72. of stdio with files and libraries that have been compiled
  73. for some other implementation.  See the file emulatate.C
  74. for details.
  75.  
  76. However, there is still a problem if when linking you
  77. search libio.a before libc.a, if you use routines in
  78. libc.a that need stdio routines that you don't call
  79. directly.  In that case the libc version of the stdio
  80. routine will be linked in, and it might not work here.
  81. Futhermore, the emulation may be slower (it works
  82. by tricking putc and getc to call a subroutine on
  83. each character.  For these reasons you may prefer to
  84. create a version of libio.a without the stdio stuff.
  85.  
  86. Doing so has not been fully tested yet, but the
  87. the following may suffice:
  88. 1) Comment out the line defining DO_STDIO_OBS in the Makefile.
  89. 2) Uncomment the definition of IMPLEMENT_STDIO in ioconfig.h.
  90. 3) Rename stdio.h to __stdio.h.
  91.  
  92. Send bug reports to Per Bothner.  Until August 7 1991, send
  93. mail to bothner@cs.wisc.edu. After then, bothner@cygnus.com.
  94. Also, send Makefiles for other configurations.
  95.